From 1c23ab5a7e98a10b53811cf5c452e64a07ce7dc9 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Mon, 11 Aug 2014 21:48:43 +0200 Subject: [PATCH] colorswatch: Update to new GtkGestureSingle/GtkEventController defaults GtkGestureSingle::button is set to 0 on the multipress gesture, as several buttons are managed by that gesture. Also avoid some extra lines of code setting what nowadays are default values. https://bugzilla.gnome.org/show_bug.cgi?id=734285 --- gtk/gtkcolorswatch.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/gtk/gtkcolorswatch.c b/gtk/gtkcolorswatch.c index 7af895661b..503d8f734b 100644 --- a/gtk/gtkcolorswatch.c +++ b/gtk/gtkcolorswatch.c @@ -89,17 +89,15 @@ gtk_color_swatch_init (GtkColorSwatch *swatch) gtk_widget_set_has_window (GTK_WIDGET (swatch), FALSE); swatch->priv->long_press_gesture = gtk_gesture_long_press_new (GTK_WIDGET (swatch)); + gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (swatch->priv->long_press_gesture), + TRUE); g_signal_connect (swatch->priv->long_press_gesture, "pressed", G_CALLBACK (hold_action), swatch); - gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (swatch->priv->long_press_gesture), - GTK_PHASE_BUBBLE); swatch->priv->multipress_gesture = gtk_gesture_multi_press_new (GTK_WIDGET (swatch)); - gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (swatch->priv->multipress_gesture), FALSE); + gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (swatch->priv->multipress_gesture), 0); g_signal_connect (swatch->priv->multipress_gesture, "pressed", G_CALLBACK (tap_action), swatch); - gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (swatch->priv->multipress_gesture), - GTK_PHASE_BUBBLE); } #define INTENSITY(r, g, b) ((r) * 0.30 + (g) * 0.59 + (b) * 0.11) -- 2.30.2